entry: Allocate the progress bar only what it needs
authorMatthias Clasen <mclasen@redhat.com>
Sun, 10 Dec 2017 04:48:35 +0000 (23:48 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 10 Dec 2017 04:48:35 +0000 (23:48 -0500)
We were allocating the progress bar to the full size
of the entry. This made entry icons loose their cursors,
since they were 'covered' by the progress bar, even though
it doesn't draw anything there.

gtk/gtkentry.c

index fec7dc406f3e8ad6e1087eb8c147b36327608cca..0ec370208efe413d6d887bdbbf6a8979b936acfd 100644 (file)
@@ -3296,11 +3296,17 @@ gtk_entry_size_allocate (GtkWidget           *widget,
   if (priv->progress_widget && gtk_widget_get_visible (priv->progress_widget))
     {
       GtkAllocation progress_alloc;
+      int min, nat;
 
+      gtk_widget_measure (priv->progress_widget,
+                          GTK_ORIENTATION_VERTICAL,
+                          -1,
+                          &min, &nat,
+                          NULL, NULL);
       progress_alloc.x = 0;
-      progress_alloc.y = 0;
+      progress_alloc.y = allocation->height - nat;
       progress_alloc.width = allocation->width;
-      progress_alloc.height = allocation->height;
+      progress_alloc.height = nat;
 
       gtk_widget_size_allocate (priv->progress_widget, &progress_alloc, -1, &child_clip);
       gdk_rectangle_union (out_clip, &child_clip, out_clip);